﻿package net.htjs.mobile.android.crm;
import net.htjs.mobile.android.crm.util.L;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.GestureDetector.OnGestureListener;
import android.view.View;
import android.view.View.OnTouchListener;

public class MyViewPager extends ViewPager implements OnTouchListener,OnGestureListener{
	
	private GestureDetector mGestureDetector=null;

	public MyViewPager(Context context) {
		super(context);
		this.mGestureDetector=new GestureDetector(this);
	}
	
	@Override
	public boolean onInterceptTouchEvent(MotionEvent arg0) {
		Log.i("tag", "pager onInterceptTouchEvent");
		return false;
	}
	
	public boolean onDown(MotionEvent arg0) {
		Log.i("tag", "pager onLongPress");
		return false;
	}

	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
			float velocityY) {
		Log.i("tag", "pager onLongPress");
		return false;
	}

	public void onLongPress(MotionEvent e) {
		Log.i("tag", "pager onLongPress");
		
	}

	public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
			float distanceY) {
		Log.i("tag", "pager onscroll");
		return false;
	}

	public void onShowPress(MotionEvent e) {
		// TODO Auto-generated method stub
		
	}

	public boolean onSingleTapUp(MotionEvent e) {
		// TODO Auto-generated method stub
		return false;
	}

	public boolean onTouch(View v, MotionEvent event) {
		Log.i("tag", "pager ontouch");
		return this.mGestureDetector.onTouchEvent(event);
	}
	

}
